#pragma once

#include <Windows.h>
#include <d3d11.h>
#include <DirectXMath.h>
#include "AlignedAllocationPolicy.h"

class CheckersApp;
class CheckersBoard;

class CheckersPiece : public AlignedAllocationPolicy<16>
{
	// Fields
	CheckersApp *app;
	DirectX::XMFLOAT3 color;
	DirectX::XMMATRIX worldMatrix;

public:
	
	// Constants
	static const int NUM_CIRCLE_VERTICES = 40;
	static const int NUM_INDICES = NUM_CIRCLE_VERTICES * 12;
	static const float CHECKERS_PIECE_RADIUS;

	// Constructor/Destructor
	CheckersPiece(CheckersApp *app);
	~CheckersPiece();

	// Methods
	void Draw();
	void PlaceOnBoard(const CheckersBoard *board, int i, int j);
	void Translate(const DirectX::XMVECTOR &delta);

	// Getters
	DirectX::XMFLOAT3 Color() const { return color; }
	DirectX::XMVECTOR Position() const { return DirectX::XMVector3Transform(DirectX::XMVectorZero(), worldMatrix);; }

	// Setters
	void SetColor(const DirectX::XMFLOAT3 &color) { this->color = color; }
};